Skip to content

fix(plugin-auth)!: a sign-up the email_domain posture admits by an invitation is not bound before its address is verified - #34969

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/sec2-q2gv-domain
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/sec2-q2gv-domain

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill under skills/** teaches the email_domain posture's invitation sign-up; content/docs/deployment/self-hosting.mdx gains the rule in this change.

维护者速读

  • 改了什么:email_domain 准入模式、membershipPolicy: 'auto' 下,邮箱域名不在白名单、凭发给该地址的待处理邀请注册的账号,邮箱验证前不加入默认组织;验证后接受邀请时按邀请写入成员关系。invite_only 与 email_domain 现在读同一个判定 isAdmittedByInvitationAlone。白名单内的地址(有无邀请)照旧在创建时绑定。
  • 为什么改:按维护者 2026-11-17 的裁决,把 invite_only 已有的「邀请注册验证前不绑定」规则扩展到 email_domain:邀请只按注册时填写的地址匹配,不能证明持有该邮箱。
  • 风险与回滚:BREAKING(窄化)。依赖白名单外受邀地址注册即入默认组织的 email_domain 部署,改为验证邮箱后接受邀请,或由平台管理员用 Add Member 挂接。回滚即 revert 本 PR。
  • 先看:packages/plugins/plugin-auth/src/audience-posture.ts 的 isAdmittedByInvitationAlone(判定本身);auth-manager-membership-admission.ts 的 validateAudienceAdmission(暂存点改读该判定);invitation-acceptance-verified-address.test.ts 新增的 email_domain describe。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run src/invitation-acceptance-verified-address.test.ts src/audience-posture.test.ts,预期 2 个文件、108 个用例全绿。
  • 需要你做的:无,席位落地(ADR-0093 修订 docs(adr-0093): a sign-up admitted by its invitation alone is not bound while its address is unverified #34909 是否扩到 email_domain 见 Acceptance notes)。

What changes

The rule. Under the email_domain audience posture with membershipPolicy: 'auto', a self-serve sign-up whose address is off the allowlist, admitted by a pending invitation addressed to it, is not bound into the deployment's organization while its address is unverified. It joins by accepting the invitation once the address is verified, which writes the membership the invitation names, or through a platform administrator's Add Member. Verifying the address binds nothing by itself. This is the rule that holds under invite_only for a sign-up admitted by the invitation it presents, carried by the same request-scoped admission.

  • packages/plugins/plugin-auth/src/audience-posture.ts: isAdmittedByInvitationAlone({ audience, creationClass, email, proof, hasPendingInvitation }) is the one decision both postures read. invite_only: a self-serve sign-up that presented its invitation. email_domain: a self-serve sign-up off the allowlist that a pending invitation admitted. open, an off-vocabulary posture, and every creation that is not self-serve: never. The module doc's invitation carve-out section states it.
  • auth-manager-membership-admission.ts: validateAudienceAdmission stages the request-scoped invitation admission (stageInvitationAdmission, unchanged) when that decision answers yes; the invitation proof it computed is kept for the decision. settleMembership and both settle seams are unchanged; the docblock and the info line name the widened rule.
  • auth-manager.ts: docblocks of the request-scoped admission store name the widened rule. No new mechanism.
  • Unchanged: an address on the allowlist, invited or not, which the domain rule admits and the membership policy binds at creation; a sign-up the invitation mail's own link verifies as it accepts; the first account, accounts an operator provisions and accounts an administrator creates; the invite_only and open postures.
  • Docs: tenancy-modes.mdx, environment-variables.mdx (OS_AUTH_MEMBERSHIP_POLICY), permissions/authentication.mdx and self-hosting.mdx state that the binding rule covers email_domain.
  • Changeset: .changeset/email-domain-invitation-sign-up-unbound-until-verified.md, @objectstack/plugin-auth patch, BREAKING, adr-0087: not-required (no-migration-prescription).
  • Fixtures: no fixture in any package mints a member through an email_domain invitation sign-up (every test file naming email_domain was read; the full plugin-auth suite passes unchanged), so none moved.

No spec, schema, stored row, route path, error code or exported signature of a published entry changes.

Tests

  • src/invitation-acceptance-verified-address.test.ts (real AuthManager over @objectstack/driver-sql on sqlite :memory:, driven through AuthManager.handleRequest), a new top-level describe, 7 cases:
    • an unverified sign-up off the allowlist, admitted by an invitation addressed to it, holds no membership, not even in the default organization;
    • verifying its address binds nothing by itself; accepting the invitation then writes its membership with the invited role;
    • an account a social provider made for that address, unverified, holds no membership and is refused at accept, decline and the listing;
    • controls: an address on the allowlist is bound at creation, uninvited and invited; an address off the allowlist that an operator provisions is bound while an invitation to it is pending; a sign-up the invitation mail's proof verifies is bound at creation and accepts the invited role; the first account, off the allowlist, is bound.
  • src/audience-posture.test.ts: isAdmittedByInvitationAlone, 4 cases (off the allowlist with an invitation; on the allowlist with or without one; invite_only presented, address and none; no invitation, operator and provider classes, open and an off-vocabulary posture).

Acceptance notes

  • ADR-0093 amendment (docs(adr-0093): a sign-up admitted by its invitation alone is not bound while its address is unverified #34909). Its note reads: "Under the invite_only audience posture with membershipPolicy: 'auto', a sign-up admitted by the invitation it presents is not bound while its email address is unverified." This PR extends the rule to email_domain, so that sentence, its status-line summary ("D1 and D7: under the invite_only audience posture, a sign-up admitted by the invitation it presents is not bound while its email address is unverified") and its D7 ledger row ("Invitation sign-up, address unverified (invite_only)") need widening to name the email_domain case: a sign-up off the allowlist that an invitation addressed to it admitted. The enforcement pointer (settleMembership) stays correct. docs/adr/** is not edited here.
  • In-domain sign-ups. Under email_domain, an address on the allowlist that also holds a pending invitation is admitted by decideAudienceAdmission's invitation branch, which precedes the domain switch (read from the code, not measured: that branch grants no self-registration permission set). The domain rule admits that address on its own, so this PR treats it as domain-admitted for binding: it binds as before, per the ruling's scope, and the rule is not widened to it. The on-allowlist control pins both the uninvited and the invited case.
  • ADR grep. ADR-0093 D1 and D7 govern the bind; no ADR states a binding rule specific to email_domain.

Verification

Head aea1743806: the code commit, a merge of origin/main at 28a733e55f (d59d48e8df), and two docs commits after it. The code is the same at d59d48e8df and aea1743806; the last commit rewords one sentence of self-hosting.mdx.

Target pins and package suite
  • pnpm --filter @objectstack/plugin-auth exec vitest run src/invitation-acceptance-verified-address.test.ts src/audience-posture.test.ts at aea1743806: Test Files 2 passed (2), Tests 108 passed (108).
  • @objectstack/plugin-auth full suite at d59d48e8df: Test Files 285 passed (285), Tests 5980 passed, 10 skipped.
  • @objectstack/runtime: not run locally. No helper that runtime tests import moved (audience-gate-test-support.ts and @objectstack/verify are untouched), and no runtime test names the email_domain posture; CI's Test Core runs it.
Workspace type check

pnpm turbo run typecheck --filter='...@objectstack/plugin-auth' --concurrency=2 (plugin-auth and every package that depends on it, with their builds) at d59d48e8df: Tasks 133 successful, 133 total, exit 0.

Derived gates: 107 of 107 run, every exit code recorded

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 107 families at d59d48e8df, and the same 107 at aea1743806. All 107 ran. 104 exited 0 on the first run. check:skill-examples and check:dual-build-cjs-loads answered exit 3 (prerequisite: some packages' dist not built) and exit 0 once built. check:role-word exited 1 on a reserved word in the new self-hosting.mdx sentence; aea1743806 rewords it and the gate exits 0. The 41 doc, changeset and link families were run again at aea1743806: 41 exited 0. --ran reconciliation: 107 derived, 107 run, 0 NOT-MEASURED, every exit code recorded.

Ablations: red, then restored

Each mutation through scripts/ablation-replace.mjs (anchor hit once), against the two target files, 108 cases:

  • The email_domain arm of isAdmittedByInvitationAlone answering no: 4 of 108 red, the three door cases of the new describe and the unit case for an address off the allowlist. Restored: blob equal to HEAD, git diff HEAD empty.
  • The same arm answering yes for every invitation-admitted email_domain sign-up: 2 of 108 red, the on-allowlist control and its unit case. Restored: blob equal to HEAD, git diff HEAD empty.
Dogfood battery

The title carries !, so the battery ran once at aea1743806, CI's command (dependency closure built, pnpm --filter @objectstack/dogfood test under the verify lock): Test Files 479 passed, 3 skipped (482); Tests 4072 passed, 68 skipped (4140); exit 0.


Generated by Claude Code

…vitation is not bound before its address is verified

Under the email_domain audience posture with membershipPolicy 'auto', a
self-serve sign-up whose address is off the allowlist and which a pending
invitation addressed to it admitted is not bound into the deployment's
organization while its address is unverified; it joins by accepting the
invitation. isAdmittedByInvitationAlone decides which admitted sign-ups the
request-scoped invitation admission covers, for invite_only and email_domain
alike. An address on the allowlist is admitted by its domain and binds as
before.

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
…il_domain posture; changeset

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-auth, touching 7 documentable anchor(s).

7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/deployment/environment-variables.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone), invite_only (literal, a string literal in isAdmittedByInvitationAlone))
  • content/docs/deployment/self-hosting.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone), invite_only (literal, a string literal in isAdmittedByInvitationAlone))
  • content/docs/deployment/tenancy-modes.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone), invite_only (literal, a string literal in isAdmittedByInvitationAlone))
  • content/docs/kernel/contracts/auth-service.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/kernel/services-checklist.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/permissions/authentication.mdx (via AuthManager (symbol, a top-level class), email_domain (literal, a string literal in isAdmittedByInvitationAlone), invite_only (literal, a string literal in isAdmittedByInvitationAlone))
  • content/docs/permissions/sso.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone), invite_only (literal, a string literal in isAdmittedByInvitationAlone))

⛔ 7 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-3.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone), invite_only (literal, a string literal in isAdmittedByInvitationAlone))
  • content/docs/releases/v17/17-5.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone))
  • content/docs/releases/v17/index.mdx (via invite_only (literal, a string literal in isAdmittedByInvitationAlone))
  • content/docs/releases/v18/18-1.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone), invite_only (literal, a string literal in isAdmittedByInvitationAlone))
  • content/docs/releases/v18/18-2.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/releases/v18/18-3.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/releases/v18/18-4.mdx (via AuthManager (symbol, a top-level class), invite_only (literal, a string literal in isAdmittedByInvitationAlone))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json fff0ad0c180c08ac8de7db8499863bdfb69842e2 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from a3aa4d291416b57bfe7e89be44f35e7244c5d41f — the merge of head aea174380649ef644be6fdf068f05453079a715a into base fff0ad0c180c08ac8de7db8499863bdfb69842e2, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin a3aa4d291416b57bfe7e89be44f35e7244c5d41f && git checkout a3aa4d291416b57bfe7e89be44f35e7244c5d41f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin fff0ad0c180c08ac8de7db8499863bdfb69842e2 aea174380649ef644be6fdf068f05453079a715a && git checkout -B drift-repro fff0ad0c180c08ac8de7db8499863bdfb69842e2 && git merge --no-ff aea174380649ef644be6fdf068f05453079a715a

node scripts/docs-audit/affected-docs.mjs --json fff0ad0c180c08ac8de7db8499863bdfb69842e2

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs fff0ad0c180c08ac8de7db8499863bdfb69842e2 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#2 · os-justin · session_01QSeKYn5CmmdShCJifm6WYj

The seat adopts the record below. It was rendered on this head at the contract-review tier by an isolated reviewer.

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: aea174380649ef644be6fdf068f05453079a715a
Local-runs: probe — one throwaway worktree at the head (since removed; the shared clone was untouched) to run the rule files and the ablations. What it ran:

  • invitation-acceptance-verified-address, audience-posture and presented-invitation: 121 passed.
  • Ablation with the email_domain arm answering no: 4 red. Restored.
  • Ablation with it answering yes for every invitation-admitted sign-up: 2 red. Restored.
  • Ablation with the invite_only arm answering no: 6 red. Restored.
  • check-adr-0087-registration and check-empty-changeset: exit 0.

The reviewer did not run the full suites, dogfood, the workspace type check, the derived gates or CI.

Scope: net diff 28a733e55f..aea1743806 (10 files, +307 −30), the PR body, and content/docs/permissions/sso.mdx at this head, which the PR does not edit.

① Derived judgments

  • The rule is enforced on every door of the ruled class.
    • isAdmittedByInvitationAlone (audience-posture.ts:551-563) answers yes under email_domain for a self-serve creation off the allowlist that a pending invitation admitted.
    • validateAudienceAdmission (auth-manager-membership-admission.ts:325) stages it on the creating request. The settle seams are unchanged.
    • A password sign-up and a provider-made account whose address the provider did not verify are both left unbound; both are pinned.
    • A creation whose own flow proves the mailbox binds, as intended (pinned).
  • The invite_only arm behaves exactly like the flag it replaces. The earlier cases stay green and turn red under ablation.
  • Over-refusal: none found. These cases still bind, and each is pinned:
    • an address on the allowlist, invited or not;
    • an operator-provisioned address off the allowlist;
    • the first account.
  • Docs.
    • self-hosting.mdx:763-770, tenancy-modes.mdx:246-253, environment-variables.mdx:100 and authentication.mdx:125-130 are accurate.
    • sso.mdx is not falsified: its email_domain statements concern admission through a registered provider and proven-domain verification, not binding.
  • PR body: accurate against the diff.

Findings

② Semver level

patch on @objectstack/plugin-auth is correct.

  • Metadata-protocol: none and Clause-②: no (narrowing) are truthful. No export of a published entry changes.
  • The BREAKING banner, !, "What to do" and the ADR-0087 not-required (no-migration-prescription) marker are all present.

③ Boundary flags

  • No governed path is touched.
  • ADR-0093's pending amendment names invite_only only. Widening it is with the maintainer.
  • A separate matter on a neighbouring surface, unchanged by this PR, is recorded with the security seat. [detail held by the security seat]

④ Design judgment

One pure decision, read by both postures and staged on the existing request-scoped record with the settle seams untouched, is the smallest correct shape. The cost is the S1 asymmetry, which is better fixed in the verdict (#34971) than by widening this rule.

Implemented-by: claude/sec2-q2gv-domain
Reviewed-by: session_01QSeKYn5CmmdShCJifm6WYj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#2 · os-justin · session_01QSeKYn5CmmdShCJifm6WYj

席位核对

ACCEPT · head aea174380649ef644be6fdf068f05453079a715a · 2026-11-17T20:12Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 20:13
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 3f5ffe7 Nov 17, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/sec2-q2gv-domain branch November 17, 2026 21:44
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…eives the declared self-registration set, and is refused when that set cannot be resolved (objectstack-ai#36312)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X8UqWLrzTYpuat8L5eLdf2c)_
Fixes objectstack-ai#34971
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill under `skills/**` teaches the audience
posture's invitation sign-up or `selfRegistrationPermissionSet`;
`content/docs/deployment/self-hosting.mdx` gains the rule in this
change.
Security-touching: yes

repo:objectstack#4 · os-project-manager ·
session_01FEkQ5pb2t8Z8C64PkPyVt1 (dev executor, area a4-B; resumed from
the released WIP `claude/issue-34971-allowlist-invite-grant@706e936`).

## 维护者速读

-
用户能看到什么变化:开放注册或按邮箱域名放行的自建部署里,被邀请的人自己注册后,和普通注册者一样拿到管理员指定给自助注册者的那组权限;若那组权限不存在或已停用,被邀请者注册也会被明确拒绝并提示去修配置。
- 为什么做:执行维护者对本单的裁决:被邀请与未被邀请的自助注册者只用一条规则,授权和入组读同一个判断,补上被邀请者少一组权限的漏洞。
-
出错会怎样:权限组配置坏掉的部署里,原本靠邀请仍能进来的人会被拒,直到管理员改好配置或直接为其建账号;没有任何账号会被多给权限;回滚即撤回本改动。
- 要你做什么:这是收紧注册权限的改动,需要你本人审阅、批准并亲手合并。L1 ACCEPT 7076000414,全量测试 4107 通过,契约
PASS 7076202877(座位 7,head ffffab1);两个小问题另立 objectstack-ai#36355 跟进。

## What changes

**The rule (ruling A, card comment 7063136215).** Under `open`, and
under `email_domain` for an address on `allowedEmailDomains`, a
self-serve sign-up is admitted by the posture's own rule whether or not
it also holds a pending invitation. It receives the declared
`selfRegistrationPermissionSet`, and when that set cannot be resolved it
is refused `403 AUTH_CONFIG_ERROR`, like an uninvited sign-up. The
invitation no longer admits it with no grant.

- `packages/plugins/plugin-auth/src/audience-posture.ts`: a
module-private `isAdmittedByPostureRule(audience, email)` (`open`: every
address; `email_domain`: an address on the allowlist; `invite_only` and
an invalid posture: none). `decideAudienceAdmission` reads it after the
social-provider address rule and before the invitation carve-out,
answering `grantPermissionSet: true`; `isAdmittedByInvitationAlone`
reads it to answer false for an address the rule admits. The grant path
in `auth-manager-membership-admission.ts` is unchanged: a verdict that
asks for the set already refuses `AUTH_CONFIG_ERROR` when
`selfRegistrationSetResolvable` answers false, so the invited sign-up
now meets that refusal. The module doc's invitation carve-out and
fail-posture paragraphs state the exception.
- Unchanged (standing readings): under `invite_only` an invitation
admits with no self-registration grant; under `email_domain` an
off-allowlist sign-up an invitation admitted gets the account and no
grant, whatever state the declared set is in; `admin_full_access` stays
refused as the self-registration set; operator, bootstrap and provider
creations.
- `content/docs/deployment/self-hosting.mdx`: "admitted by its domain,
invitation or not" now holds for the grant and the binding, and a new
paragraph states the fail-closed refusal for both postures.
-
`packages/spec/src/migrations/entries/semantic/18.self-registration-permission-set-reaches-invited-sign-ups.ts`:
the ADR-0087 D3 semantic entry (the one spec path), registered by the
changeset's `registered` marker.
-
`packages/qa/dogfood/test/signup-organization-census-walled.dogfood.test.ts`:
the open-posture invitee now holds the declared set on its first
membership (the battery found the stale fixture).
- `.changeset/34971-allowlist-invite-grant.md`: BREAKING, `Clause-②: no
(narrowing)`, `Metadata-protocol: none`, `patch` on
`@objectstack/plugin-auth` and `@objectstack/spec`.

| posture | invited | address | before | after |
|:---|:---|:---|:---|:---|
| `invite_only` | yes (presented) | any | admit, no grant | same |
| `email_domain` | yes | on list | admit, NO grant, bound | admit,
GRANT, bound |
| `email_domain` | yes | off list | admit, no grant, unbound until
accept | same |
| `open` | yes | any | admit, NO grant, bound | admit, GRANT, bound |
| `open` / `email_domain` on list | no | | admit, grant, bound | same |
| the two changed rows, declared set unresolvable | | | admitted
ungranted | refused `AUTH_CONFIG_ERROR` (the narrowing) |

## Tests

All readings under `scripts/pm/os-verify-lock.sh`, tree
`objectstack-ai/objectstack`; the source of the change is unchanged from
`ca290ccdc` to the head `ffffab1779` (the two later commits touch only
test files).

<details><summary>plugin-auth and spec (at ca290cc, after merging
origin/main a5a5312)</summary>

- `pnpm --filter @objectstack/plugin-auth test`: Test Files 291 passed
(291); Tests 6204 passed, 10 skipped (6214); exit 0. The one red the WIP
left (`presented-invitation.test.ts`, the `open` row) is rewritten here.
- `pnpm --filter @objectstack/plugin-auth typecheck`: exit 0;
`check:test-typecheck` OK (debt ledger held).
- `pnpm --filter @objectstack/spec build`, `typecheck`, and `exec vitest
run --maxWorkers=2 src/migrations` (5 files, 198 tests): all exit 0; the
new entry reaches `registry.ts` and `dist/migrations/index.{js,mjs}`.
- At `0ef10daa0b`: the three target files, `audience-posture.test.ts`,
`invitation-acceptance-verified-address.test.ts`,
`presented-invitation.test.ts`: 3 files, 152 tests passed.

</details>

<details><summary>Ablations (src read by relative import, no dist leg),
restored to the HEAD blob fc4dbd6</summary>

- M1, the subject of the new pins: `if
(isAdmittedByPostureRule(audience, email))` mutated to `if
(!hasPendingInvitation && isAdmittedByPostureRule(audience, email))`
(the old order). Mutation landed (anchor 1 to 0, blob changed); 3 files:
9 failed, 143 passed. Red: the four invited unresolvable-set refusal
rows (open and email_domain on the list, missing and switched off), the
two invited verdict rows, the social on-list row, and the invited grant
pins under email_domain on the list and under open. Restored: blob
equals HEAD, `git diff HEAD` empty.
- M2, the subject of the controls: the invitation-alone branch's
`grantPermissionSet: false` mutated to `true`. 36 failed, 116 passed.
Red include every CONTROL: the off-allowlist invited sign-up with a
missing set, the off-allowlist and `invite_only` no-grant pins, and the
`presented-invitation.test.ts` email_domain row. Restored: blob equals
HEAD, `git diff HEAD` empty.

</details>

<details><summary>Dogfood battery (the title carries !)</summary>

- At `0ef10daa0b`: closure build `pnpm --filter
'@objectstack/dogfood^...' build` exit 0, then `pnpm --filter
@objectstack/dogfood test`: Test Files 1 failed, 483 passed, 3 skipped
(487); Tests 2 failed, 4105 passed, 68 skipped (4175). Both failures are
one stale fixture this change makes false:
`signup-organization-census-walled.dogfood.test.ts`, the grant-writer
case under `group` and `isolated`, asserting the open-posture invitee
holds no declared set.
- Fixed in `ffffab1779` to the ruled behaviour (the invitee's declared
grant settles on its first membership, the inviting organization). Rerun
at `ffffab1779`: that file and its `single` sibling
`signup-organization-census.dogfood.test.ts`, 2 files, 15 tests passed.
The full battery was not rerun on the new head; the only change is that
test file.

</details>

## Acceptance notes

- `boot-sign-in-reachability.ts` (outside this card's file surface) says
`decideAudienceAdmission` short-circuits on `hasPendingInvitation`
before the posture switch, admitting under every posture. It stays true
of the switch; the posture-rule check now precedes the invitation, and
under `open` / on-list `email_domain` with an unresolvable set an
invitation no longer admits. Not edited here. Carried by objectstack-ai#36355 (with
the `self-hosting.mdx` open-posture half-clause, contract review
7076202877 N1 and N3).
- Dispatch and claim spell `Clause-②: no (narrowing)` (copied); the
decision analysis 7062693710 suggested `yes (narrowing)` for a diff that
widens who receives the set and narrows the unresolvable case. Left for
the contract review.
- The dispatch asked for an ADR-0087 migration entry; objectstack-ai#34969 and objectstack-ai#35200
used `not-required (no-migration-prescription)` instead. This change
registers a semantic entry, so `os migrate meta` and the upgrade guide
carry the notice.

## Verification

<details><summary>Dispatch-gate families at ffffab1</summary>

- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` over 8 changed paths: 115 families, each run
with its exit code recorded before any pipe; `--ran` reconciliation: 115
derived, 115 run, 0 NOT-MEASURED, 0 UNRUN, every one exit 0.
- On the first pass (at `ca290ccdc`) `check:test-source-alias` was red
on the edited `presented-invitation.test.ts` (collection reaches the
dynamic import of `@objectstack/core/egress`); fixed by the module-top
import its two sibling test files carry (`0ef10daa0b`).
- `check:adr-0087-registration`: the changeset is
`[BREAKING+bang+clause-②-narrowing]`, `registered
self-registration-permission-set-reaches-invited-sign-ups (new here)`.
- `overlap-check` before each push: clean against origin/main and objectstack-ai#35129
(shares `self-hosting.mdx`, merges cleanly).
- Local-only `check:dev-prereqs`: exit 1, the box's workspace is not
fully built (35 `ui/` and other dists absent); a machine-state reading,
not about this diff.

</details>

**Read first (by risk):** `audience-posture.ts`
`decideAudienceAdmission` (the new `isAdmittedByPostureRule` branch
ahead of `if (hasPendingInvitation)`); `isAdmittedByInvitationAlone`;
the new `it.each` refusal pins in `audience-posture.test.ts`
(end-of-chain describe).

**Two-minute check:** `pnpm --filter @objectstack/plugin-auth exec
vitest run --maxWorkers=2 src/audience-posture.test.ts
src/invitation-acceptance-verified-address.test.ts
src/presented-invitation.test.ts` — expect 3 files green.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1

<!-- signed: repo:objectstack#4 · os-project-manager ·
session_01FEkQ5krBqrrgxCYgjXmfbv -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant